package com.useeinfo.oa.modules.security.entity;

import com.alibaba.fastjson.JSONObject;
import com.useeinfo.framework.extend.entity.SuperClassEntity;
import com.useeinfo.oa.modules.base.entity.Enterprise;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 用户角色企业
 */
@Entity
@Table(name = "user_role_enterprise")
public class UserRoleEnterprise extends SuperClassEntity<UserRoleEnterprise> {

    /**
     * 所属角色
     */
    @ManyToOne
    @JoinColumn(name = "role_id")
    private SystemRole systemRole;
    /**
     * 所属企业
     */
    @ManyToOne
    @JoinColumn(name = "enterprise_id")
    private Enterprise enterprise;
    /**
     * 所属企业
     */
    @ManyToOne
    @JoinColumn(name = "user_id")
    private SystemUser systemUser;

    public UserRoleEnterprise(SystemRole systemRole, Enterprise enterprise, SystemUser systemUser) {
        this.systemRole = systemRole;
        this.enterprise = enterprise;
        this.systemUser = systemUser;
    }

    public UserRoleEnterprise() {
    }

    @Override
    public JSONObject toJSONObject() {

        return null;
    }

    public SystemRole getSystemRole() {
        return systemRole;
    }

    public void setSystemRole(SystemRole systemRole) {
        this.systemRole = systemRole;
    }

    public Enterprise getEnterprise() {
        return enterprise;
    }

    public void setEnterprise(Enterprise enterprise) {
        this.enterprise = enterprise;
    }


    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }
}
